package urldecode;




import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.List;

public class JSave {
	
	public void Add (String targetFile,String content) throws IOException {
		FileWriter fw = new FileWriter(targetFile,true);
		fw.write(content+"\r\n");
		fw.close();
	}
	public void Add (File targetFile,String content) throws IOException {
		FileWriter fw = new FileWriter(targetFile,true);
		fw.write(content+"\r\n");
		fw.close();
	}
	public void Add (String targetFileName,List<String> content) throws Exception {
		FileWriter fw = new FileWriter(targetFileName,true);
		
		for (String c : content) {
			fw.write(c+"\r\n");
		}
		fw.close();
	}
	public void Add (File targetFile,List<String> content) throws Exception {
		FileWriter fw = new FileWriter(targetFile,true);
		
		for (String c : content) {
			fw.write(c+"\r\n");
		}
		fw.close();
	}
//	public void Add (File targetFile,File sourceFile) throws Exception {
//		RandomAccessFile raf = new RandomAccessFile(sourceFile,"r");
//		FileWriter fw = new FileWriter(targetFile,true);
//		String line;
//		while (( line = raf.readLine()) != null) {
//			
//		}
//		fw.close();
//	}
}
